import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';

@Injectable({
    providedIn: 'root'
})
export class FrontPageService {
    private changeLayers = new Subject();
    private reloadLayers = new Subject();
    private changeLocationLonLat = new Subject();
    layersObservable = this.changeLayers.asObservable();
    reloadLayersObservable = this.reloadLayers.asObservable();
    LocationLonLatObservable = this.changeLocationLonLat.asObservable();

    constructor() {
    }

    $changeNewLayersObservable(data) {
        this.changeLayers.next(data);
    }

    $reloadLayers(data) {
        this.reloadLayers.next(data);
    }

    $locationLonLat(data) {
        this.changeLocationLonLat.next(data);
    }
}
